import { Component } from "@angular/core";
import { NavController } from "ionic-angular";

@Component({
  selector: "page-home",
  templateUrl: "home.html"
})
export class HomePage {
  btn: any;
  num: number = 0;
  step: number = -18;
  disab:boolean;

  constructor(public navCtrl: NavController) {}
  panEvent(e) {
    this.btn = document.getElementById("btn");
    if (e.additionalEvent == "panright") {
      this.btn.style.left = this.step++ + "px";
      this.num = 18 + this.step++;
    } else if (e.additionalEvent == "panleft") {
      this.btn.style.left = this.step-- + "px";
      this.num = 18 + this.step--;
      if (this.step == -18) {
        this.btn.style.left = -18 + "px";
      }
    }
  }

  change(event:any){
    this.num = event.target.value
    if(this.num >= 10){
      // this.disab = true;
    }else if(this.num <= 10){
      // this.disab = false;
    }
  }
 
}
